package com.zyd.databindingdemo;

import androidx.databinding.BaseObservable;

/**
 * 单向绑定 1
 *  全部属性：继承BaseObservable类,并将对象的属性添加set和get方法 再加一个notifyChange();
 *  部分属性：在该属性的get方法上添加 @Bindable， 把 notifyChange()换成notifyPropertyChanged(BR.name);
 */
public class Person extends BaseObservable {
    public int age;
    public String name;

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
        notifyChange();
    }
}



